package com.zzf.spring6.test;


import com.zzf.spring6.dao.UserDao;
import com.zzf.spring6.service.UserService;
import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class springDItest {
    @Test
    public void testSetDI(){
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring.xml");
        UserDao userDao = (UserDao) applicationContext.getBean("userDaoBean", UserDao.class);
        UserService userService = (UserService) applicationContext.getBean("userServiceBean", UserService.class);
    }
}
